#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N = 2e5;
#define INF 0x7fffffff
typedef long long int ll;
const ll mod= 59084709587506;
using namespace std;
//----------------------------------------------------------------------------//
void divide(ll&x)
{

    for (ll i = 2; i <= x / i; i++)
        if (x % i == 0)
        {
            ll s = 0;
            while (x % i == 0) x /= i, s++;
            cout << i <<"^" << s << endl;
        }
    if (x > 1) cout << x <<"^" << 1 << endl;
    cout << endl;
}
void solve()
{
	int ans=0;
	ll qs = 59084709587505;
	divide(qs);
	for (ll i = 1; i <= qs;i*=3)
	{
		for (ll j = 1; j*i <= qs; j*=5)
		{
			for (ll k = 1; k*j*i <= qs; k*=7)
			{
				ans++;
			}
		}
	}
	pd(ans-1);//三个质因子都无
}

int main()
{
	int T = 1;
	//sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}